package com.scuthnweb.action.adminadmodule;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.scuthnweb.domain.Role;
import com.scuthnweb.domain.Sy_user;
import com.scuthnweb.service.AdminAdModule;
import com.scuthnweb.tool.QueryValidateModule;

public class OthersCheckUserInfoAction extends ActionSupport{
	private Integer uid;
	private AdminAdModule adminAdModule;
	private QueryValidateModule queryValidateModule;
	
	
	public String execute(){
		ActionContext ctx = ActionContext.getContext();
		Integer user_id = (Integer) ctx.getSession().get("user_id");
		Role role = this.queryValidateModule.userWholeRole(user_id);
		Object result = null;
		if(role.equals("normal_user")){
			result = this.adminAdModule.othersCheckUserInfo(uid, false);		
		}else{
			result = this.adminAdModule.othersCheckUserInfo(uid, true);
		}
		ctx.getSession().put("user_info", result);
		ctx.getSession().put("role_name", role.getRole_name());
		return SUCCESS;
	}
	
	public AdminAdModule getAdminAdModule() {
		return adminAdModule;
	}
	public void setAdminAdModule(AdminAdModule adminAdModule) {
		this.adminAdModule = adminAdModule;
	}
	public QueryValidateModule getQueryValidateModule() {
		return queryValidateModule;
	}
	public void setQueryValidateModule(QueryValidateModule queryValidateModule) {
		this.queryValidateModule = queryValidateModule;
	}
	public Integer getUid() {
		return uid;
	}
	public void setUid(Integer uid) {
		this.uid = uid;
	}

}
